package com.finchina.myview;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;

import com.finchina.myview.androidviewhelpers.CustomViewScrollers;

/**
 * 作者：黄赛赛 on 2015/9/2 16:40
 *http://blog.csdn.net/chaoyue0071/article/details/44038641
 * @version V1.0
 * @Description: ${todo}()
 */
public class TestActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_viewhelper_srcoller);

        /*ImageView ic_clip = (ImageView) findViewById(R.id.ic_clip);
       final Drawable drawable = (Drawable) ic_clip.getDrawable();

        ValueAnimator va =  ValueAnimator.ofInt(10,10000);
        va.setDuration(5000);
        va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                int value = (int) animation.getAnimatedValue();
//                Log.e("onAnimationUpdate", " value = " + value);
                if (drawable !=null)
                drawable.setLevel( value);
            }
        });
        va.start();*/

      customviewscroll = (CustomViewScrollers) findViewById(R.id.customviewscroll);
        handler.sendEmptyMessageDelayed(100,3000);

    }
    com.finchina.myview.androidviewhelpers.CustomViewScrollers customviewscroll;
    Handler handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            customviewscroll.smoothScrollBy(-300,-600);
        }
    };

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}
